

const path = require('path');
const staticImg = path.join(__dirname, 'static');

function SensorbitUnoBlocks(Blockly) {
    var base_color = "#179b73";



        //旋转电位器
Blockly.Blocks.microbit_resistance = {
    init:function(){
      this.setColour(base_color);
      this.appendDummyInput("")
       .appendField(new Blockly.FieldImage(staticImg+"/16.Rotary  potentiometer.svg", 84, 42))
        .appendField(Blockly.Msg.MICROBIT_PIN)
        .appendField(new Blockly.FieldDropdown([
            ['P0', "pin0"],
            ['P1', "pin1"],
            ['P2', "pin2"],
        ]),"resistance")
          .appendField(Blockly.Msg.MICROBIT_READRESISTANCE)
    this.setOutputShape(Blockly.OUTPUT_SHAPE_ROUND);
        this.setOutput(true, 'Number');
      this.setTooltip('');
    }
    };

    return Blockly;
}

module.exports = SensorbitUnoBlocks;

